package com.heima.juc.unlock;

import lombok.extern.slf4j.Slf4j;
import sun.misc.Unsafe;

import java.lang.reflect.Field;

/**
 * @author : leimingchao
 * @date Date : 2022年02月12日 22:29
 */
@Slf4j(topic = "c.TestUnsafe")
public class TestUnsafe {

    public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException {
        Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
        theUnsafe.setAccessible(true);
        Unsafe unSafe = (Unsafe) theUnsafe.get(null);
        System.out.println(unSafe);
    }
}
